import { defineFakeRoute } from 'vite-plugin-fake-server/client';
import MockJS from 'mockjs';
export default defineFakeRoute([
  {
    url: '/dict/getDictList',
    method: 'get',
    response: () => {
      const mockData = MockJS.mock({
        code: 0,
        'data|50': [
          {
            'id|+1': 1,
            name: '@cword(4, 8)',
            code: '@id()',
            description: '@cparagraph(0,3)',
            createTime: '@datetime'
          }
        ]
      });
      return mockData;
    }
  },
  {
    url: '/dict/getDictItemList',
    method: 'get',
    response: () => {
      const mockData = MockJS.mock({
        code: 0,
        data: {
          'rows|12': [
            {
              'id|+1': 1,
              itemName: '@cword(4, 8)',
              itemCode: '@integer(1, 50)',
              itemAttribute: '@cparagraph(0,3)',
              createTime: '@datetime'
            }
          ],
          page: 1,
          total: 12
        }
      });
      return mockData;
    }
  }
]);
